<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMerchantGiftTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('merchant_gift', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('礼物名称');
            $table->string('desc')->nullable()->comment('礼物描述');
            $table->string('img')->nullable();
            $table->tinyInteger('category')->comment('类别：1 金币，2 积分, 3 兑换某车辆，4 实物');
            $table->integer('item')->nullable()->comment('类别属性');
            $table->timestamp('begin_datetime')->nullable()->comment('投放开始时间');
            $table->timestamp('end_datetime')->nullable()->comment('投放结束时间');
            $table->tinyInteger('is_open')->default(1)->comment('是否投放');
            $table->integer('stock')->default(0)->comment('投放数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('merchant_gift');
    }
}
